﻿using System.Dynamic;

namespace blog.Service.HelpFunc;

public class ExtraFunc
{
    public static bool IsPropertyExist(dynamic data, string propertyname)
    {
        if (data is ExpandoObject)
            return ((IDictionary<string, object>)data).ContainsKey(propertyname);
        return data.GetType().GetProperty(propertyname) != null;
    }
    
    public static bool isEmpty(dynamic obj)
    {
        if(obj == "" || obj == null)
        {
            return true;
        }
        return false;
    }
    
    
    
}